
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
  <head>
    <title>Your Desk</title> 
    <link rel="stylesheet" type="text/css" href="static/navbar.css" />
    <link rel="stylesheet" type="text/css" href="static/main.css" />
    <script type="text/javascript" src="static/tabber.js"></script> 
    <script type="text/javascript" src="static/compressed_form.js"></script>
    <SCRIPT>
  		mobwrite.syncGateway = 'http://mobwrite3.appspot.com/scripts/q.py';
	</SCRIPT>
    </head>
  <body onload="init();">
    <div id="wd-navbar">
      <ul>
        <li>
        <a class="first"><form action="/home" method="post">
           <input type="submit" value="<-- Reselect Desk" name="home" class="myButton" id=></input>
           <input name='user_name' class='hidden_object' value={{user_name}}>
        </form></a>	
        </li>
        <li>
          <a href="/">Logout</a>
        </li>
        <li>
          <a>Papers</a>
          <ul>
          {% for doc in my_docs %}
            <li>
              <a class="first"><form action="/desk" method="post">
                        <input type="submit" value={{doc}} name={{doc}} class="myButton"></input>
                        <input name='desk_name' class='hidden_object' value={{desk_name}}>
                        <input name='user_name' class='hidden_object' value={{user_name}}>
              </form></a>
            </li>
          {% endfor %}
          </ul>
        </li>
<li>
          <a>Peers</a>
          <ul>
          {% for peer in peers %}
            <li>
              <a class="first"><form action="/desk" method="post">
                        <input type="submit" value="{{peer}}" name="{{peer}}" class="myButton"></input>
                        <input name='desk_name' class='hidden_object' value={{desk_name}}>
                        <input name='user_name' class='hidden_object' value={{user_name}}>
              </form></a>
            </li>
          {% endfor %}
          </ul>
                </li>
         <li>
          <a href="static/about.html">About</a>
        </li>
        
        <li id='uid'>
                {{user_name}}
        </li>
        <li id='desk_name'>
                {{desk_name}}
        </li>
      </ul>
    </div>
    <div id='side_navbar'>
      <ul>
        {% for user in peers %}
          <li>{{peers}}</li>
          <li>TEST</li>
        {% endfor %}
      </ul>
      
    </div>
        
     <!-- BEGIN JAVASCRIPT TABS -->
     
     
     <div class="desk_contents">
     <ul id="tabs">
     <li><a href='#Instructions'>Instructions</a></li> 
     <li><a href="#NEW">NEW</a></li>
    {% for my_doc in my_open_docs %}       
     <li><a href='#{{my_doc}}'>{{my_doc}}</a></li>  
    {% endfor %}
     </ul> 
     
      <div class="tabContent" id=Instructions>
      	<div> 
      		<h1>Instructions</h1></br>
      			<h3>Go to papers to load any of your saved documents.</br>
			      Go to peers to load all the open documents of anyone else at</br> the table.</br></br>
			      Uncheck visibility when saving to prevent peers from seeing</br> your document.</br>
			      Uncheck Peer Editing to prevent other users from editing your</br> document, but allow them to view it.</br></br>
			      Press Save to implement any changes to your document (including</br> visibility and peer editing).</br>
			      Press Close to close any open documents (<font color="red">Will not auto-save so</br> make sure to save prior to closing</font>).</h3>
        </div>  
    </div>  
      
      <div class="tabContent" id="NEW"> 
              <h2>NEW DOCUMENT</h2> 
              <div> 
                <form action='/desk' method='post'>
                    <input type="text" name="doc_name" style="width: 425px;" id="title_new_{{desk_name}}"></br>
                                <textarea class="paper" name="paper" id="paper_new_{{desk_name}}"></textarea></br>
                                <input name="save" type="submit" value="Save" >
                                <label for="sharing">Allow Peer Editing:</label> <input name="sharing" type="checkbox" value="Allow Peer Editing" id="sharing" >
                                <label for="Visibility">Visibility:</label> <input name="visibility" type="checkbox" value="Visibility" id="Visibility" >
                                <input name='desk_name' class='hidden_object' value={{desk_name}}>
                                <input name='user_name' class='hidden_object' value={{user_name}}>
                </form>
              </div>
      </div>
      
          
     {% for my_doc, doc_text in docs.items %}
     
         
      <div class="tabContent" id={{my_doc}}>
      <div> 
      <h2>{{doc_name}}</h2> 
      <form action='/desk' method='post'> 
                <input type="text" name="doc_name" style="width: 425px;" value={{my_doc}} id="title_{{my_doc}}_{{desk_name}}"></br>
                                <textarea class="paper" name="paper" id="paper_{{my_doc}}_{{desk_name}}">{{doc_text}}</textarea></br>
                                <input name="save" type="submit" value="Save" >
                                <label for="sharing">Allow Peer Editing:</label> <input name="sharing" type="checkbox" value="Allow Peer Editing" id="sharing" >
                                <label for="Visibility">Visibility:</label> <input name="visibility" type="checkbox" value="Visibility" id="Visibility" >
                                <input name="close" type="submit" value="Close" >
                                
                        <input name='desk_name' class='hidden_object' value={{desk_name}}>
                        <input name='user_name' class='hidden_object' value={{user_name}}>
        </form>
        </div>  
    </div> 
    <script>
      mobwrite.share('paper_{{my_doc}}_{{desk_name}}', 'title_{{my_doc}}_{{desk_name}}');
    </script> 

    {% endfor %}
    
  </body>
</html>
   
